import React, {useState} from "react";
import {Button, Drawer, Modal, Space, Spin} from "antd";
import {CheckOutlined, PoweroffOutlined} from "@ant-design/icons";
import styled from "@emotion/styled";

interface DownLoadFileProp {
	open: boolean;
	onCancel: (isLoad: boolean) => void;
}

export const DownLoadFile: React.FC<DownLoadFileProp> = ({open, onCancel}) => {

	const [spinning, setSpinning] = useState<boolean>(false);
	const submitEnd = () => {

	}

	const closeModel = () => {
		onCancel(false);
	}

	return <Container
		width='30vw'
		destroyOnClose
		maskClosable={false}
		onCancel={() => onCancel(false)}
		open={open}
		title="链接下载"
		okText="保存"
		cancelText="取消"
		footer={
			<Space>
				<Button type="primary" danger onClick={closeModel} icon={<PoweroffOutlined />}>关闭</Button>
				<Button type="primary" onClick={submitEnd} icon={<CheckOutlined />}>保存</Button>
			</Space>
		}
	>
		<Spin tip="加载中......" spinning={spinning}>

		</Spin>
	</Container>

}

const Container = styled(Modal)`
	.ant-modal-body {
		margin-top: 30px;
	}
`